Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to replace primaryKey field via config #706

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asgraf
Copy link

@asgraf asgraf commented Oct 24, 2023

Example use case:

$this->Crud->action()->setConfig('primaryKey', 'uuid');

this change makes FriendsOfCake/crud plugin compatible with dereuromark/cakephp-expose

Example:
$this->Crud->action()->setConfig('primaryKey', 'uuid');
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f437194) 90.45% compared to head (90dfe38) 90.46%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #706   +/-   ##
=========================================
  Coverage     90.45%   90.46%           
  Complexity      369      369           
=========================================
  Files            36       36           
  Lines          1153     1154    +1     
=========================================
+ Hits           1043     1044    +1     
  Misses          110      110           
Files Coverage Δ
src/Traits/FindMethodTrait.php 80.55% <100.00%> (+0.55%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ADmad
Copy link
Member

ADmad commented Oct 25, 2023

  • Test(s) required for the change.
  • The primaryKey config should be added to $_defaultConfig of all actions that use the FindMethodTrait::_findRecord() method.
  • Docs need to be updated to provide info about this new option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants